package astra.client.pages;

import astra.client.Astra;
import astra.client.models.Employee;
import astra.client.services.AstraServiceAsync;
import com.google.gwt.uibinder.client.UiConstructor;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.SimplePanel;

/**
 * @author Kotelnikov Dmitry <a href="mailto:dimonnot@mail.ru"/>
 */
public abstract class Page extends Composite {
    protected String name;
    protected AstraServiceAsync service;
    protected Astra astra;

    public Page(String name) {
        this.name = name;
        this.service = Astra.service;
        this.astra = Astra.astra;
    }

    public abstract void show();

    public Employee getEmployee() {
        return astra.getEmployee();
    }

    protected void showActions(FlowPanel actions) {
        astra.setActions(actions);
    }

    public String getName() {
        return name;
    }
}
